package com.open.capacity.finance.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 凭证
 *
 * @author
 * @email
 * @date 2020-06-05 17:40:41
 */

@Data
public class Pz implements Serializable {
    private static final long serialVersionUID = 1L;

    private String pzid;

    @NotBlank
    @Length(max = 50)
    private String companyId;

    @NotBlank
    @Length(max = 50)
    private String ztId;

    @TableField(exist = false)
    private String companyName;

    @TableField(exist = false)
    private String ztName;

    @NotNull
    private Integer kjnd;

    private Integer kjqj;

    private String pzlxCode;

    private String pzlxName;

    @TableField(exist = false)
    private String pzlx;

    @NotBlank
    @Length(max = 32)
    private String pzz;

    @NotBlank
    @Length(max = 16)
    private String pzh;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date pzrq;

    private Integer fj;

    @NotBlank
    @Length(max = 50)
    private String cwzg;

    private String cny;

    private String shy;

    private String jzy;

    @NotBlank
    @Length(max = 50)
    private String zdy;

    private Integer isQc;

    private Integer isJz;

    private Integer isTemp;

    private String remark;

    private Integer status;

    @JsonFormat(timezone="GMT+8",pattern="yyyy-MM-dd HH:mm:ss.SSS")
    private Date updateTime;

    private String updateUsername;


    //1 临时，2 期初，3 结转
    @TableField(exist = false)
    private Integer category;

    @TableField(exist = false)
    private String zy;

    @TableField(exist = false)
    private BigDecimal j;

    @TableField(exist = false)
    public BigDecimal d;

    /**
     * 合计金额（大写）
     */
    @TableField(exist = false)
    private String total1;

    /**
     * 合计金额（小写）
     */
    @TableField(exist = false)
    private BigDecimal total2;

    @TableField(exist = false)
    private Integer totalCount;

    @TableField(exist = false)
    private Integer accountedCount;

    @TableField(exist = false)
    private Integer authedCount;

    @TableField(exist = false)
    private List<Pzfl> pzflList;

}
